#include<stdio.h>
#include<stdlib.h>
long g[105],b[105];
int n,m;
int sosanh(const void *a,const void *b){
    return (int)((*(long *)b)-(*(long *)a));
}
void input(){
    scanf("%d%d",&n,&m);
    int i;
    for(i=0;i<n;i++)scanf("%ld",&g[i]);
    for(i=0;i<m;i++)scanf("%ld",&b[i]);
    qsort(g,n,sizeof(long),sosanh);
    qsort(b,m,sizeof(long),sosanh);
    
}
long tinh(int s){
    long x=0,y=0,i=0;
    for(i=s;i<n;i++)x+=g[i];
    for(i=s;i<m;i++)y+=b[i];
    return x+s*y;
}
void giai(){
    int i,min=n;
    if(min>m)min=m;
    
    
    long result,minResult=1000000000l;
    for(i=0;i<=min;i++){
        result=tinh(i);
        if(minResult>result)minResult=result;
    }
    printf("%ld",minResult);
}
int main(){
    input();
    giai();
    return 0;
}

